#include <iostream>
using namespace std;
class A
{
public:
	A(int a)
		:_a(a)
	{
		cout << "A(int a)" << endl;
	}

	A(int a, int b)
		:_a(a)
		, _b(b)
	{
		cout << "A(int a, int b)" << endl;
	}
	A(const A& a)
	{
		_a = a._a;
		_b = a._b;
		cout << "A(const A& a)" << endl;
	}
private:
	//ȱʡֵ
	int _a;
	int _b;
};

typedef int DataType;
class Stack
{
public:
	Stack(size_t capacity = 4)
	{
		_array = (DataType*)malloc(sizeof(DataType) * capacity);
		if (NULL == _array)
		{
			perror("malloc申请空间失败!!!");
			return;
		}
		_capacity = capacity;
		_size = 0;
	}

	void Push(DataType data)
	{
		// CheckCapacity();
		_array[_size] = data;
		_size++;
	}

	// 其他方法...
	~Stack()
	{
		if (_array)
		{
			free(_array);
			_array = NULL;
			_capacity = 0;
			_size = 0;
		}
	}

private:
	DataType* _array;
	int _capacity;
	int _size;
};

class B
{
private:
	int _b = 1;
	int* _ptr = (int*)malloc(sizeof(int));
	Stack _pushst = 10;
	A a1 = 1;
	A a2 = { 1,2 };
	A a3 = a2;
};

int main()
{

	return 0;
}